package cn.rongdao.jrkabao.model.information.apply;

import android.os.Build;

import com.mifengkong.frtools.app.FRApplication;
import com.mifengkong.frtools.http.request.HttpFunction;
import com.mifengkong.frtools.util.FRDeviceUtil;
import com.mifengkong.frtools.util.NetWorkUtil;

import java.util.Map;

import cn.rongdao.jrkabao.R;
import cn.rongdao.jrkabao.bean.information.apply.OrderResultBean;
import cn.rongdao.jrkabao.model.api.BaseSuDaiModel;
import io.reactivex.Observable;
import io.reactivex.Observer;

/**
 * Created by jack on 17/5/5
 * 获取邮箱网银列表
 */

public class LoanApplyModel extends BaseSuDaiModel {

    public static LoanApplyModel getInstance() {
        return getPresent(LoanApplyModel.class);
    }

    public void execute(Map<String, String> map, Observer<OrderResultBean> observer) {
        addParamStrings(map);
        addParamStrings("net_info", NetWorkUtil.getCurrentNetworkType());
        addParamStrings("dev_no", FRDeviceUtil.getPhoneModels());
        addParamStrings("dev_sys", String.valueOf(Build.VERSION.SDK_INT));
        addParamStrings("app_name", FRApplication.getInstance().getResources().getString(R.string.app_name));
        addParamStrings(map);
        Observable<OrderResultBean> observable = mServletApi.applyLoan(mParams).map(new HttpFunction<OrderResultBean>());
        toSubscribe(observable, observer);
    }
}